// ++++++++++++++++++++++++++++++++++++++++
// 《零基础Go语言算法实战》源码
// ++++++++++++++++++++++++++++++++++++++++
// Author:廖显东（ShirDon）
// Blog:https://www.shirdon.com/
// Gitee:https://gitee.com/shirdonl/goAlgorithms.git
// Buy link :https://item.jd.com/14101229.html
// ++++++++++++++++++++++++++++++++++++++++

package main

import "fmt"

func main() {
	// 声明一个包含 5 个整数的数组
	var nums [5]int

	//用一些值初始化数组
	nums[0] = 1
	nums[1] = 2
	nums[2] = 3
	nums[3] = 4
	nums[4] = 5

	//打印整个数组
	fmt.Println(nums)

	//访问数组的单个元素
	fmt.Println(nums[0])
	fmt.Println(nums[2])
}

//$ go run array.go
//[1 2 3 4 5]
//1
//3
